Optimal. Leaf size=316 \[ -\frac {\left (\frac {1}{16}+\frac {i}{16}\right ) ((1+i) A+B) \text {ArcTan}\left (1-\sqrt {2} \sqrt {\cot (c+d x)}\right )}{\sqrt {2} a^3 d}+\frac {\left (\frac {1}{16}+\frac {i}{16}\right ) ((1+i) A+B) \text {ArcTan}\left (1+\sqrt {2} \sqrt {\cot (c+d x)}\right )}{\sqrt {2} a^3 d}+\frac {(A+i B) \cot ^{\frac {3}{2}}(c+d x)}{6 d (i a+a \cot (c+d x))^3}+\frac {A \sqrt {\cot (c+d x)}}{4 a d (i a+a \cot (c+d x))^2}+\frac {(2 i A+B) \sqrt {\cot (c+d x)}}{8 d \left (i a^3+a^3 \cot (c+d x)\right )}+\frac {(2 i A+(1-i) B) \log \left (1-\sqrt {2} \sqrt {\cot (c+d x)}+\cot (c+d x)\right )}{32 \sqrt {2} a^3 d}-\frac {(2 i A+(1-i) B) \log \left (1+\sqrt {2} \sqrt {\cot (c+d x)}+\cot (c+d x)\right )}{32 \sqrt {2} a^3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.49, antiderivative size = 316, normalized size of antiderivative = 1.00, number of steps
used = 14, number of rules used = 10, integrand size = 36, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.278, Rules used = {3662, 3676,
3677, 3615, 1182, 1176, 631, 210, 1179, 642} \begin {gather*} -\frac {\left (\frac {1}{16}+\frac {i}{16}\right ) (B+(1+i) A) \text {ArcTan}\left (1-\sqrt {2} \sqrt {\cot (c+d x)}\right )}{\sqrt {2} a^3 d}+\frac {\left (\frac {1}{16}+\frac {i}{16}\right ) (B+(1+i) A) \text {ArcTan}\left (\sqrt {2} \sqrt {\cot (c+d x)}+1\right )}{\sqrt {2} a^3 d}+\frac {(B+2 i A) \sqrt {\cot (c+d x)}}{8 d \left (a^3 \cot (c+d x)+i a^3\right )}+\frac {(2 i A+(1-i) B) \log \left (\cot (c+d x)-\sqrt {2} \sqrt {\cot (c+d x)}+1\right )}{32 \sqrt {2} a^3 d}-\frac {(2 i A+(1-i) B) \log \left (\cot (c+d x)+\sqrt {2} \sqrt {\cot (c+d x)}+1\right )}{32 \sqrt {2} a^3 d}+\frac {(A+i B) \cot ^{\frac {3}{2}}(c+d x)}{6 d (a \cot (c+d x)+i a)^3}+\frac {A \sqrt {\cot (c+d x)}}{4 a d (a \cot (c+d x)+i a)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 631
Rule 642
Rule 1176
Rule 1179
Rule 1182
Rule 3615
Rule 3662
Rule 3676
Rule 3677
Rubi steps
\begin {align*} \int \frac {A+B \tan (c+d x)}{\sqrt {\cot (c+d x)} (a+i a \tan (c+d x))^3} \, dx &=\int \frac {\cot ^{\frac {3}{2}}(c+d x) (B+A \cot (c+d x))}{(i a+a \cot (c+d x))^3} \, dx\\ &=\frac {(A+i B) \cot ^{\frac {3}{2}}(c+d x)}{6 d (i a+a \cot (c+d x))^3}+\frac {\int \frac {\sqrt {\cot (c+d x)} \left (-\frac {3}{2} a (i A-B)+\frac {3}{2} a (3 A-i B) \cot (c+d x)\right )}{(i a+a \cot (c+d x))^2} \, dx}{6 a^2}\\ &=\frac {(A+i B) \cot ^{\frac {3}{2}}(c+d x)}{6 d (i a+a \cot (c+d x))^3}+\frac {A \sqrt {\cot (c+d x)}}{4 a d (i a+a \cot (c+d x))^2}+\frac {\int \frac {-3 i a^2 A+3 a^2 (3 A-2 i B) \cot (c+d x)}{\sqrt {\cot (c+d x)} (i a+a \cot (c+d x))} \, dx}{24 a^4}\\ &=\frac {(A+i B) \cot ^{\frac {3}{2}}(c+d x)}{6 d (i a+a \cot (c+d x))^3}+\frac {A \sqrt {\cot (c+d x)}}{4 a d (i a+a \cot (c+d x))^2}+\frac {(2 i A+B) \sqrt {\cot (c+d x)}}{8 d \left (i a^3+a^3 \cot (c+d x)\right )}+\frac {\int \frac {-3 i a^3 B-3 a^3 (2 i A+B) \cot (c+d x)}{\sqrt {\cot (c+d x)}} \, dx}{48 a^6}\\ &=\frac {(A+i B) \cot ^{\frac {3}{2}}(c+d x)}{6 d (i a+a \cot (c+d x))^3}+\frac {A \sqrt {\cot (c+d x)}}{4 a d (i a+a \cot (c+d x))^2}+\frac {(2 i A+B) \sqrt {\cot (c+d x)}}{8 d \left (i a^3+a^3 \cot (c+d x)\right )}+\frac {\text {Subst}\left (\int \frac {3 i a^3 B+3 a^3 (2 i A+B) x^2}{1+x^4} \, dx,x,\sqrt {\cot (c+d x)}\right )}{24 a^6 d}\\ &=\frac {(A+i B) \cot ^{\frac {3}{2}}(c+d x)}{6 d (i a+a \cot (c+d x))^3}+\frac {A \sqrt {\cot (c+d x)}}{4 a d (i a+a \cot (c+d x))^2}+\frac {(2 i A+B) \sqrt {\cot (c+d x)}}{8 d \left (i a^3+a^3 \cot (c+d x)\right )}+\frac {\left (\left (\frac {1}{16}+\frac {i}{16}\right ) ((1+i) A+B)\right ) \text {Subst}\left (\int \frac {1+x^2}{1+x^4} \, dx,x,\sqrt {\cot (c+d x)}\right )}{a^3 d}-\frac {(2 i A+(1-i) B) \text {Subst}\left (\int \frac {1-x^2}{1+x^4} \, dx,x,\sqrt {\cot (c+d x)}\right )}{16 a^3 d}\\ &=\frac {(A+i B) \cot ^{\frac {3}{2}}(c+d x)}{6 d (i a+a \cot (c+d x))^3}+\frac {A \sqrt {\cot (c+d x)}}{4 a d (i a+a \cot (c+d x))^2}+\frac {(2 i A+B) \sqrt {\cot (c+d x)}}{8 d \left (i a^3+a^3 \cot (c+d x)\right )}+\frac {\left (\left (\frac {1}{32}+\frac {i}{32}\right ) ((1+i) A+B)\right ) \text {Subst}\left (\int \frac {1}{1-\sqrt {2} x+x^2} \, dx,x,\sqrt {\cot (c+d x)}\right )}{a^3 d}+\frac {\left (\left (\frac {1}{32}+\frac {i}{32}\right ) ((1+i) A+B)\right ) \text {Subst}\left (\int \frac {1}{1+\sqrt {2} x+x^2} \, dx,x,\sqrt {\cot (c+d x)}\right )}{a^3 d}+\frac {(2 i A+(1-i) B) \text {Subst}\left (\int \frac {\sqrt {2}+2 x}{-1-\sqrt {2} x-x^2} \, dx,x,\sqrt {\cot (c+d x)}\right )}{32 \sqrt {2} a^3 d}+\frac {(2 i A+(1-i) B) \text {Subst}\left (\int \frac {\sqrt {2}-2 x}{-1+\sqrt {2} x-x^2} \, dx,x,\sqrt {\cot (c+d x)}\right )}{32 \sqrt {2} a^3 d}\\ &=\frac {(A+i B) \cot ^{\frac {3}{2}}(c+d x)}{6 d (i a+a \cot (c+d x))^3}+\frac {A \sqrt {\cot (c+d x)}}{4 a d (i a+a \cot (c+d x))^2}+\frac {(2 i A+B) \sqrt {\cot (c+d x)}}{8 d \left (i a^3+a^3 \cot (c+d x)\right )}+\frac {(2 i A+(1-i) B) \log \left (1-\sqrt {2} \sqrt {\cot (c+d x)}+\cot (c+d x)\right )}{32 \sqrt {2} a^3 d}-\frac {(2 i A+(1-i) B) \log \left (1+\sqrt {2} \sqrt {\cot (c+d x)}+\cot (c+d x)\right )}{32 \sqrt {2} a^3 d}+-\frac {\left (\left (\frac {1}{16}+\frac {i}{16}\right ) ((1+i) A+B)\right ) \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1+\sqrt {2} \sqrt {\cot (c+d x)}\right )}{\sqrt {2} a^3 d}+\frac {\left (\left (\frac {1}{16}+\frac {i}{16}\right ) ((1+i) A+B)\right ) \text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-\sqrt {2} \sqrt {\cot (c+d x)}\right )}{\sqrt {2} a^3 d}\\ &=-\frac {\left (\frac {1}{16}+\frac {i}{16}\right ) ((1+i) A+B) \tan ^{-1}\left (1-\sqrt {2} \sqrt {\cot (c+d x)}\right )}{\sqrt {2} a^3 d}+\frac {\left (\frac {1}{16}+\frac {i}{16}\right ) ((1+i) A+B) \tan ^{-1}\left (1+\sqrt {2} \sqrt {\cot (c+d x)}\right )}{\sqrt {2} a^3 d}+\frac {(A+i B) \cot ^{\frac {3}{2}}(c+d x)}{6 d (i a+a \cot (c+d x))^3}+\frac {A \sqrt {\cot (c+d x)}}{4 a d (i a+a \cot (c+d x))^2}+\frac {(2 i A+B) \sqrt {\cot (c+d x)}}{8 d \left (i a^3+a^3 \cot (c+d x)\right )}+\frac {(2 i A+(1-i) B) \log \left (1-\sqrt {2} \sqrt {\cot (c+d x)}+\cot (c+d x)\right )}{32 \sqrt {2} a^3 d}-\frac {(2 i A+(1-i) B) \log \left (1+\sqrt {2} \sqrt {\cot (c+d x)}+\cot (c+d x)\right )}{32 \sqrt {2} a^3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 2.20, size = 272, normalized size = 0.86 \begin {gather*} \frac {e^{-4 i (c+d x)} \left (\left (A+i B+A e^{2 i (c+d x)}-2 i B e^{2 i (c+d x)}\right ) \left (-1-2 e^{2 i (c+d x)}+e^{4 i (c+d x)}+2 e^{6 i (c+d x)}\right )-3 A e^{6 i (c+d x)} \sqrt {-1+e^{4 i (c+d x)}} \text {ArcTan}\left (\sqrt {-1+e^{4 i (c+d x)}}\right )-6 (A-i B) e^{6 i (c+d x)} \sqrt {-1+e^{2 i (c+d x)}} \sqrt {1+e^{2 i (c+d x)}} \tanh ^{-1}\left (\sqrt {\frac {-1+e^{2 i (c+d x)}}{1+e^{2 i (c+d x)}}}\right )\right ) \sqrt {\cot (c+d x)} \sec (c+d x) (\cos (3 (c+d x))-i \sin (3 (c+d x)))}{96 a^3 d} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 4 vs. order
3.
time = 24.88, size = 15195, normalized size = 48.09
method | result | size |
default | \(\text {Expression too large to display}\) | \(15195\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 635 vs. \(2 (247) = 494\).
time = 1.46, size = 635, normalized size = 2.01 \begin {gather*} \frac {{\left (3 \, a^{3} d \sqrt {\frac {i \, A^{2} + 2 \, A B - i \, B^{2}}{a^{6} d^{2}}} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (-\frac {2 \, {\left ({\left (i \, a^{3} d e^{\left (2 i \, d x + 2 i \, c\right )} - i \, a^{3} d\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}} \sqrt {\frac {i \, A^{2} + 2 \, A B - i \, B^{2}}{a^{6} d^{2}}} + {\left (A - i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{i \, A + B}\right ) - 3 \, a^{3} d \sqrt {\frac {i \, A^{2} + 2 \, A B - i \, B^{2}}{a^{6} d^{2}}} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (-\frac {2 \, {\left ({\left (-i \, a^{3} d e^{\left (2 i \, d x + 2 i \, c\right )} + i \, a^{3} d\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}} \sqrt {\frac {i \, A^{2} + 2 \, A B - i \, B^{2}}{a^{6} d^{2}}} + {\left (A - i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{i \, A + B}\right ) + 24 \, a^{3} d \sqrt {-\frac {i \, A^{2}}{64 \, a^{6} d^{2}}} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (\frac {{\left (8 \, {\left (a^{3} d e^{\left (2 i \, d x + 2 i \, c\right )} - a^{3} d\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}} \sqrt {-\frac {i \, A^{2}}{64 \, a^{6} d^{2}}} + i \, A\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{8 \, a^{3} d}\right ) - 24 \, a^{3} d \sqrt {-\frac {i \, A^{2}}{64 \, a^{6} d^{2}}} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (-\frac {{\left (8 \, {\left (a^{3} d e^{\left (2 i \, d x + 2 i \, c\right )} - a^{3} d\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}} \sqrt {-\frac {i \, A^{2}}{64 \, a^{6} d^{2}}} - i \, A\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{8 \, a^{3} d}\right ) + 2 \, {\left (2 \, {\left (A - 2 i \, B\right )} e^{\left (6 i \, d x + 6 i \, c\right )} + {\left (A + 4 i \, B\right )} e^{\left (4 i \, d x + 4 i \, c\right )} - {\left (2 \, A - i \, B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - A - i \, B\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}}\right )} e^{\left (-6 i \, d x - 6 i \, c\right )}}{96 \, a^{3} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {i \left (\int \frac {A}{\tan ^{3}{\left (c + d x \right )} \sqrt {\cot {\left (c + d x \right )}} - 3 i \tan ^{2}{\left (c + d x \right )} \sqrt {\cot {\left (c + d x \right )}} - 3 \tan {\left (c + d x \right )} \sqrt {\cot {\left (c + d x \right )}} + i \sqrt {\cot {\left (c + d x \right )}}}\, dx + \int \frac {B \tan {\left (c + d x \right )}}{\tan ^{3}{\left (c + d x \right )} \sqrt {\cot {\left (c + d x \right )}} - 3 i \tan ^{2}{\left (c + d x \right )} \sqrt {\cot {\left (c + d x \right )}} - 3 \tan {\left (c + d x \right )} \sqrt {\cot {\left (c + d x \right )}} + i \sqrt {\cot {\left (c + d x \right )}}}\, dx\right )}{a^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {A+B\,\mathrm {tan}\left (c+d\,x\right )}{\sqrt {\mathrm {cot}\left (c+d\,x\right )}\,{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^3} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________